package info.mykhaylov.entities;

import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

// JAXBB
@XmlRootElement

// Persistance
@Entity
@Table(name = "LOGINS")

// Lombok
@Data
@EqualsAndHashCode(exclude = {"id", "password"})
public class Login {
	@Id
	@Column(updatable = false, nullable = false)
	private long id;

	@NotNull
	@Column(
		name = "login",
		length = 255,
		nullable = false,
		updatable = false,
		unique = true
	)
	private String eMail;

	@NotNull
	@Column(length = 255, nullable = false, updatable = true, unique = false)
	private String password;
}
